linear and circular permutation